home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
gnu
/
difutl27.zip
/
difutl27
/
memchr.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-09-12
|
313b
|
20 lines
/* Support memchr on systems where it doesn't work. */
#include <config.h>
#include <sys/types.h>
void *
memchr (s, c, n)
void const *s;
int c;
size_t n;
{
unsigned char const *p = s;
unsigned char const *lim = p + n;
for (; p < lim; p++)
if (*p == c)
return p;
return 0;
}